// pages/judgeinfo/judgeinfo.js
Page({
  data: {
    index:'',
    finishtime:'2022-5-25 9:30',
    phone:'12302541031',
    
    list:'',
    nice_url : '/static/image/笑脸.png',
    common_url :'/static/image/平静 (1).png',
    worried_url : '/static/image/哭脸.png',
    flag_url:null,

    judge_text:'',
    tempFilePaths: []

  },
  onLoad:function(options){
    var judgelist = JSON.parse(options.judgelist)
    // console.log(judgelist)
    if(judgelist.judgelevel === '优'){
      this.setData({
        nice_url:'/static/image/笑脸后.png',
      })
    }else if(judgelist.judgelevel === '良'){
        this.setData({
        common_url :'/static/image/平静后.png',
        })
    }else{
     this.setData({
       worried_url : '/static/image/哭脸后.png'
     })
    }
    
    this.setData({
      judge_text:judgelist.judgetext,
      list:judgelist,
      tempFilePaths:JSON.parse(judgelist.judgepic)
    })
    console.log(JSON.parse(this.data.list.judgepic))

  },
  listenerButtonPreviewImage: function (e) {
    let index = e.target.dataset.index;
    // console.log(index)
    let that = this;
    // console.log(that.data.tempFilePaths[index]);
    // console.log(that.data.tempFilePaths);
    wx.previewImage({
      current: that.data.tempFilePaths[index],
      urls: that.data.tempFilePaths,
      //这根本就不走
      success: function (res) {
        //console.log(res);
      },
      //也根本不走
      fail: function () {
        //console.log('fail')
      }
    })
  },

  
})